<LayoutEditFormBox :loading="load">
    <template slot="main">

        <el-form ref="editForm" :model="form" label-width="200px" label-position="left">

            <LayoutCell>
                <LayoutCellItem title="基础">
                    <el-form-item label="关系链">
                        <el-radio-group v-model="form.isOpen">
                            <el-radio :label="1">开启</el-radio>
                            <el-radio :label="0">关闭</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="获取推广资格条件" v-if="form.isOpen">
                        <el-radio-group v-model="form.conditionType">
                            <el-radio :label="1">自动成为</el-radio>
                            <el-radio :label="2" disabled>申请</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="升级条件" v-if="form.isOpen">
                        <el-radio-group v-model="form.qualified">
                            <el-radio :label="1">无条件</el-radio>
                            <el-radio :label="2">同时满足勾选条件</el-radio>
                            <el-radio :label="3">满足任一勾选条件</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item v-if="form.isOpen && form.qualified !=1">
                        <el-checkbox v-model="form.subscribeWeChatMp.isSelect" :true-label="1" :false-label="0">关注公众号
                        </el-checkbox>
                    </el-form-item>
                    <el-form-item v-if="form.isOpen && form.qualified !=1">
                        <el-checkbox v-model="form.memberLevel.isSelect" :true-label="1" :false-label="0">会员等级
                        </el-checkbox>
                        <el-button type="primary" @click="selectLevel" style="margin-left:10px;"
                            v-if="form.memberLevel.isSelect">
                            选择会员等级
                        </el-button>
                    </el-form-item>
                    <el-form-item label=" 已选择等级" v-if="form.isOpen && form.qualified !=1 && form.memberLevel.isSelect">
                        <el-tag class="tagStyle" v-for="(tag,index) in showLevelNameList" :key="tag.id" closable
                            @close="deleteTag(index)">
                            {{tag.name}}
                        </el-tag>
                    </el-form-item>


                    <el-form-item v-if="form.isOpen && form.qualified !=1">
                        <el-checkbox v-model="form.buyProduct.isSelect" :true-label="1" :false-label="0">购买指定商品
                        </el-checkbox>
                        <span class="tips">下单任意一件商品后计入</span>
                    </el-form-item>
                    <el-form-item v-if="form.isOpen && form.qualified !=1 && form.buyProduct.isSelect">
                        <!-- //count 选择商品数量  -1 不限制  0不可选择 正整数为可选多少项 -->
                        <SelectDataGoods v-model="goodsIds" :appWindow="appWindow" :count="-1"></SelectDataGoods>
                    </el-form-item>
                    <el-form-item v-if="form.isOpen && form.qualified !=1" prop="consumeCount.conditionValue"
                        :rules="[{trigger: ['blur','change'] ,validator:function(rule, value, callback){validatorConsumeCount(rule, value, callback)}}]">
                        <el-checkbox v-model="form.consumeCount.isSelect" :true-label="1" :false-label="0">消费次数大于等于
                        </el-checkbox>
                        <el-input v-model="form.consumeCount.conditionValue" style="width: 200px;margin-left: 20px;"
                            maxlength="10" :disabled="!form.consumeCount.isSelect">
                            <template slot="append">次</template>
                        </el-input>
                        <span class="tips">下单次数，支付后计入</span>
                    </el-form-item>
                    <el-form-item v-if="form.isOpen && form.qualified !=1" prop="consumeAmount.conditionValue"
                        :rules="[{trigger: ['blur','change'] ,validator:function(rule, value, callback){validatorConsumeAmount(rule, value, callback)}}]">
                        <el-checkbox v-model="form.consumeAmount.isSelect" :true-label="1" :false-label="0">消费金额大于等于
                        </el-checkbox>
                        <el-input v-model="form.consumeAmount.conditionValue" style="width: 200px;margin-left: 20px;"
                            maxlength="10" :disabled="!form.consumeAmount.isSelect">
                            <template slot="append">元</template>
                        </el-input>
                        <span class="tips">实付金额+积分抵扣+余额抵扣总金额，支付后计入</span>
                    </el-form-item>
                    <el-form-item v-if="form.isOpen && form.qualified !=1" prop="rechargeCount.conditionValue"
                        :rules="[{trigger: ['blur','change'] ,validator:function(rule, value, callback){validatorRechargeCount(rule, value, callback)}}]">
                        <el-checkbox v-model="form.rechargeCount.isSelect" :true-label="1" :false-label="0">充值次数大于等于
                        </el-checkbox>
                        <el-input v-model="form.rechargeCount.conditionValue" style="width: 200px;margin-left: 20px;"
                            maxlength="10" :disabled="!form.rechargeCount.isSelect">
                            <template slot="append">次</template>
                        </el-input>
                        <span class="tips">会员充值次数</span>
                    </el-form-item>
                    <el-form-item v-if="form.isOpen && form.qualified !=1" prop="rechargeAmount.conditionValue"
                        :rules="[{trigger: ['blur','change'] ,validator:function(rule, value, callback){validatorRechargeAmount(rule, value, callback)}}]">
                        <el-checkbox v-model="form.rechargeAmount.isSelect" :true-label="1" :false-label="0">充值金额大于等于
                        </el-checkbox>
                        <el-input v-model="form.rechargeAmount.conditionValue" style="width: 200px;margin-left: 20px;"
                            maxlength="10" :disabled="!form.rechargeAmount.isSelect">
                            <template slot="append">元</template>
                        </el-input>
                        <span class="tips">会员充值金额</span>
                    </el-form-item>
                    <el-form-item v-if="form.isOpen && form.qualified !=1">
                        <el-radio-group v-model="form.conditionNode">
                            <el-radio :label="1">付款后</el-radio>
                            <el-radio :label="2">完成后</el-radio>
                        </el-radio-group>
                        <span class="tips">消费条件统计的方式</span>
                    </el-form-item>
                    <el-form-item label="锁定客户的标准" v-if="form.isOpen">
                        <el-radio-group v-model="form.relationNode">
                            <el-radio :label="1">首次点击分享链接</el-radio>
                            <el-radio :label="2">首次下单</el-radio>
                            <el-radio :label="3">首次付款</el-radio>
                        </el-radio-group>
                        <span class="tips">首次下单/首次付款,无条件不可用</span>
                    </el-form-item>

                </LayoutCellItem>

            </LayoutCell>


        </el-form>
    </template>
    <template slot="footer">
        <el-button type="primary" @click="submit">确定</el-button>
    </template>
</LayoutEditFormBox>